package com.oepm.web.controller;

import com.oepm.common.entity.Meta;
import com.oepm.common.entity.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin//解决跨域
@RestController
@RequestMapping("/unauthorized")
@Api(tags = "权限控制管理")
public class ShiroController {


    @GetMapping( value = "/token",produces = "application/json;charset=utf-8")
    @ApiOperation("token认证失败")
    public Result token()  {
        return new Result(Meta.TOKEN_ERROR);
    }

    @GetMapping( value = "/noRole",produces = "application/json;charset=utf-8")
    @ApiOperation("权限不足")
    public Result noRole()  {
        return new Result(Meta.UNAUTHORISE);
    }
}
